#define _CRT_SECURE_NO_WARNINGS 1
#pragma warning(disable:6031)
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
    int N;
    while (scanf("%d",&N) != EOF) 
    {
        int i = 0;
        int set = N;
        int j = 1;
        while (set >= 10)
        {
            set = set / 10;
            j++;
        }
        int len = j;
        for (; len != 0; len--)
        {
            int x = len;
            int set2 = N;
            for (x = len-1; x != 0; x--)
            {
                set2 = set2 / 10;
            }
            printf("%d", set2);
            if ((len-1) % 3 == 0)
                printf(",");
        }
    }
	return 0;
}
//int main()
//{
//    char a, b;
//    while ( gets(a,b)!= EOF) 
//    {
//
//
//
//    }
//	return 0;
//}